package controllers

import (
	"gdshop-back-end-go/common/request/BaseReq"
	"gdshop-back-end-go/common/response"
	"gdshop-back-end-go/service-member/MemberService"
	"github.com/gogf/gf/net/ghttp"
)

type MemberController struct {
	*BaseController
}

func NewMemberController(inputReq *BaseReq.I) *MemberController {
	return &MemberController{
		&BaseController{Req: inputReq},
	}
}

func (c *MemberController) SetStatus(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkIds(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return MemberService.SetStatus(r, c.Req)
}

func (c *MemberController) ReSetPwd(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkId(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return MemberService.ReSetPwd(r, c.Req)
}
